@extends('layouts.template')

@section('title', '管理后台')

@section('content')

    <script>
        $(function(){

            var form = new Vue({
                el:'#contentpanel',
                data:{
                },
                computed:{
                },
                mounted:function(){
                },
                watch: {
                },
                methods:{
                },
                components:{
                }
            });

        });

    </script>

    <div class="panel-body">
        <div class="panel panel-default">
            <div class="panel-body">
                <form action="" method="GET" class="form-inline">
                    <div>
                        {!! $filter !!}
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="contentpanel" id="contentpanel">

        <div class="row">
            <div class="col-md-12">
                <div class="table-responsive">
                    <table class="table mb30">
                        <thead>
                        <tr style="white-space:nowrap">
                            <th><input type="checkbox" onclick="checkall(this)">选择</th>
                            <th>发放领取时间</th>
                            <th>用户名</th>
                            <th>券号</th>
                            <th>优惠券名称</th>
                            <th>有效期</th>
                            <th>优惠券面额（元）</th>
                            <th>使用条件</th>
                            <th>使用状态</th>
                            <th>使用时间</th>
                            <th>使用的订单号</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach ($list as $row):?>
                            <tr data-id="{{$row->c_id}}">
                                <td><input type="checkbox" value="{{$row->c_id}}" name="user[]"></td>
                                <td>{{$row->cg_add_time}}</td>
                                <td>{{$row->merchant->me_username}}</td>
                                <td>{{$row->cg_number}}</td>
                                <td>{{$row->coupon->c_name}}</td>
                                <td>{{$row->vaildtime_text}}</td>
                                <td>{{$row->coupon->c_money}}</td>
                                <td>满{{$row->coupon->c_fullmoney}}元即可使用</td>
                                <td>{{$row->status_text}}</td>
                                <td>{{$row->cg_use_time}}</td>
                                <td>{{$row->cg_user_order_number}}</td>
                                <td>
                                    <a onclick="return confirm('确定')" href="{{url("coupon/delgrant/{$row->cg_id}")}}" class="btn btn-danger">删除</a>
                                </td>
                            </tr>
                        <?php endforeach;?>
                        </tbody>
                    </table>
                </div>
                <!-- table-responsive -->
                {{ @!$list->isEmpty() ? $list->appends(request()->all())->links() : '' }}
            </div>
            <!-- col-md-12 -->
        </div>
    </div><!-- contentpanel -->


@endsection

